/**
 * @Date 2020-06-24 16:22:15
 * @Remark
 */

import { Api } from "@/public/model/api";
import { ReqById, ReqPage, ResBoolean, ResObject, ResPage } from "@/public/model/base";
import { MemberListDto } from "./model";

/**
 * api
 */
export const API_MEMBERLIST_PAGE: Api = {
  title: "会员分页",
  path: "memberList/list",
  method: "POST",
  prefix: "api/backstage",
  remark: "会员memberList操作接口",
};

// req
export interface ReqMemberListPage extends ReqPage {
  memebersTypeID?: number;
  membersLeverID?: number;
  regTime?: string;
}

// res
export type ResMemberListPage = ResPage<MemberListDto>;

/**
 * api
 */
export const API_MEMBERLIST_ADD: Api = {
  title: "添加会员",
  path: "memberList/add",
  method: "POST",
  prefix: "api/backstage",
  remark: "会员memberList操作接口",
};

// req
export interface ReqMemberListAdd {
  memebersTypeID: string;
  membersLeverID: string;
  userName: string;
  moblie: string;
  company: string;
  WeChat: string;
  email: string;
  headerImg: string;
}

// res
export type ResMemberListAdd = ResObject<MemberListDto>;

/**
 * api
 */
export const API_MEMBERLIST_UPDATE: Api = {
  title: "编辑会员",
  path: "memberList/update",
  method: "POST",
  prefix: "api/backstage",
  remark: "会员memberList操作接口",
};

// req
export interface ReqMemberListUpdate extends ReqById, ReqMemberListAdd {}

// res
export type ResMemberListUpdate = ResObject<MemberListDto>;

/**
 * api
 */
export const API_MEMBERLIST_DEL: Api = {
  title: "删除会员",
  path: "memberList/delete",
  method: "POST",
  prefix: "api/backstage",
  remark: "会员memberList操作接口",
};

// req
export type ReqMemberListDel = ReqById;

// res
export type ResMemberListDel = ResBoolean;

/**
 * api
 */
export const API_MEMBERLIST_FINDALLCLASS: Api = {
  title: "获取所有会员类型",
  path: "memberList/findAllType",
  method: "POST",
  prefix: "api/backstage",
  remark: "会员memberList操作接口",
};

// req
export interface ReqMemberListFindAllClass {
  id?: number;
}

// res
export interface ResMemberListFindAllClass {
  result: number;
  message: string;
  data: [];
}

/**
 * api
 */
export const API_MEMBERLIST_LEVEL: Api = {
  title: "获取所有会员类型",
  path: "memberList/findAllLevel",
  method: "POST",
  prefix: "api/backstage",
  remark: "会员memberList操作接口",
};

// req
export interface ReqMemberListFindAllLevel {
  id?: number;
}

// res
export interface ResMemberListFindAllLevel {
  result: number;
  message: string;
  data: [];
}

/**
 * api
 */
export const API_MEMBERLIST_DISABLED: Api = {
  title: "修改会员状态",
  path: "memberList/undateDisabled",
  method: "POST",
  prefix: "api/backstage",
  remark: "会员memberList操作接口",
};

// req
export interface ReqMemberListDisabled {
  id: number;
  ISdisable: number;
}

// res
export type ResMemberListDisabled = ResBoolean;

/**
 * api
 */
export const API_MEMBERLIST_RELEASEACTIVITY: Api = {
  title: "会员发布的活动数量",
  path: "memberList/releaseActivity",
  method: "POST",
  prefix: "api/backstage",
  remark: "会员memberList操作接口",
};

// req
export interface ReqReleaseActivityCount {
  userID: string;
}

// res
export interface ResReleaseActivityCount {
  result: number;
  message: string;
  data: {
    total: number;
  };
}

/**
 * api
 */
export const API_MEMBERLIST_RELEASEARTICLE: Api = {
  title: "会员发布的文章数量",
  path: "memberList/releaseArticle",
  method: "POST",
  prefix: "api/backstage",
  remark: "会员memberList操作接口",
};

// req
export interface ReqReleaseArticleCount {
  userID: string;
}

// res
export interface ResReleaseArticleCount {
  result: number;
  message: string;
  data: {
    total: number;
  };
}

/**
 * api
 */
export const API_MEMBERLIST_PARTICIPATEACTIVITY: Api = {
  title: "会员参与活动数量",
  path: "memberList/participateActivity",
  method: "POST",
  prefix: "api/backstage",
  remark: "会员memberList操作接口",
};

// req
export interface ReqParticipateActivityCount {
  userID: string;
}

// res
export interface ResParticipateActivityCount {
  result: number;
  message: string;
  data: {
    total: number;
  };
}

/**
 * api
 */
export const API_MEMBERLIST_GETINFO: Api = {
  title: "获取会员信息",
  path: "memberList/getInfo",
  method: "POST",
  prefix: "api/backstage",
  remark: "会员memberList操作接口",
};

// req
export interface ReqMemberListGetInfo {
  sysUserID: string;
}

// res
export type ResMemberListGetInfo = ResObject<MemberListDto>;
